import BaseApi from "./BaseApi";

const controller = "/home";

export default {
    getTruckStatus() {
        return this.requestPost(controller, "/getTruckStatus", null);
    },
    payType() {
        return this.requestPost(controller, "/payType", null);
    },
    online() {
        return this.requestPost(controller, "/online", null);
    },
    moneyOrder() {
        return this.requestPost(controller, "/moneyOrder", null);
    },
    weekOrder() {
        return this.requestPost(controller, "/weekOrder", null);
    },
    truckStatistics() {
        return this.requestPost(controller, "/truckStatistics", null);
    },
    appeal() {
        return this.requestPost(controller, "/appeal", null);
    },
    user() {
        return this.requestPost(controller, "/user", null);
    },
    paringTime() {
        return this.requestPost(controller, "/paringTime", null);
    },
    truckMap() {
        return this.requestPost(controller, "/truckMap", null);
    },
    truckUseByTime() {
        return this.requestPost(controller, "/truckUseByTime", null);
    },
    weekOrderNum() {
        return this.requestPost(controller, "/weekOrderNum", null);
    },

    //请求封装
    requestGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestGet(newUrl, condition);
    },
    requestPost(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPost(newUrl, condition);
    },
    requestPostForJson(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPostForJson(newUrl, condition);
    },
}